'''
Created on 2014-5-27

@author: ASUS
'''
from read_list_from_file.read_guess_list import read_guess
import numpy as np
import matplotlib.pyplot as plt
import math

def draw_distance():
    guess=read_guess()
    for one in guess:
        ASINs=[]
        distance=[]
        for each in one['distances']:
            ASINs.append(each['guess_ASIN'])
            distance.append(each['distance'])
        distance.sort()
        
        print math.sqrt(np.var(distance))
        print len(distance)
        for one in distance:
            print (one-np.mean(distance))/math.sqrt(np.var(distance))

if __name__ == '__main__':
    draw_distance()